#include "roman13.h"
#include <nds.h>

using namespace WoopsiUI;

static const u16 Roman13_glyphdata[510] = {
/* '!' */	0xFF40,
/* '"' */	0xB680,0x0000,0x0000,
/* '#' */	0x1212,0x22FF,0x2424,0xFF48,0x4848,0x0000,0x0000,0x0000,
/* '$' */	0x7569,0x4E1C,0xB5AB,0x8800,0x0000,
/* '%' */	0x6124,0x8922,0x5064,0x0260,0xA449,0x1248,0x6000,0x0000,0x0000,0x0000,
/* '&' */	0x3048,0x4848,0x3060,0x928A,0x8C73,0x0000,0x0000,0x0000,
/* ''' */	0xE000,
/* '(' */	0x2949,0x2491,0x2200,
/* ')' */	0x8912,0x4925,0x2800,
/* '*' */	0x27C8,0xA000,0x0000,0x0000,0x0000,
/* '+' */	0x0000,0x4081,0x1FC4,0x0810,0x0000,0x0000,0x0000,
/* ',' */	0x0070,
/* '-' */	0x0000,0x3800,0x0000,
/* '.' */	0x0040,
/* '/' */	0x1122,0x2444,0x8800,0x0000,
/* '0' */	0x7A18,0x6186,0x1861,0x85E0,0x0000,0x0000,
/* '1' */	0x2E92,0x4924,0x0000,
/* '2' */	0x7A10,0x4104,0x2108,0x43F0,0x0000,0x0000,
/* '3' */	0x7A10,0x4138,0x1041,0x85E0,0x0000,0x0000,
/* '4' */	0x0861,0x8A29,0x24BF,0x0820,0x0000,0x0000,
/* '5' */	0x7D04,0x20FA,0x1041,0x85E0,0x0000,0x0000,
/* '6' */	0x7A18,0x20BB,0x1861,0x85E0,0x0000,0x0000,
/* '7' */	0xFC20,0x8410,0x8210,0x4100,0x0000,0x0000,
/* '8' */	0x7A18,0x617A,0x1861,0x85E0,0x0000,0x0000,
/* '9' */	0x7A18,0x618D,0xD041,0x89C0,0x0000,0x0000,
/* ':' */	0x1040,
/* ';' */	0x1070,
/* '<' */	0x0000,0x4662,0x0606,0x0400,0x0000,0x0000,
/* '=' */	0x0000,0x07F0,0x003F,0x8000,0x0000,0x0000,0x0000,
/* '>' */	0x0008,0x1818,0x1198,0x8000,0x0000,0x0000,
/* '?' */	0x7462,0x1111,0x0802,0x0000,0x0000,
/* '@' */	0x0F83,0x0440,0x24E9,0x919A,0x09A1,0x1A12,0xA329,0xDC40,0x1206,0x1F80,0x0000,0x0000,
/* 'A' */	0x080A,0x0502,0x8221,0x11FC,0x8280,0xC040,0x0000,0x0000,0x0000,
/* 'B' */	0xFD06,0x0C1F,0xD060,0xC183,0xF800,0x0000,0x0000,
/* 'C' */	0x388A,0x0C08,0x1020,0x4144,0x7000,0x0000,0x0000,
/* 'D' */	0xF90A,0x0C18,0x3060,0xC185,0xF000,0x0000,0x0000,
/* 'E' */	0xFF02,0x040F,0xF020,0x4081,0xFC00,0x0000,0x0000,
/* 'F' */	0xFE08,0x20FA,0x0820,0x8200,0x0000,0x0000,
/* 'G' */	0x3C42,0x8180,0x808F,0x8181,0x423C,0x0000,0x0000,0x0000,
/* 'H' */	0x8306,0x0C1F,0xF060,0xC183,0x0400,0x0000,0x0000,
/* 'I' */	0xFFC0,
/* 'J' */	0x0842,0x1084,0x318B,0x8000,0x0000,
/* 'K' */	0x8182,0x8488,0x90B0,0xC884,0x8281,0x0000,0x0000,0x0000,
/* 'L' */	0x8208,0x2082,0x0820,0x83F0,0x0000,0x0000,
/* 'M' */	0x80E0,0xF074,0x5A2C,0xA653,0x2988,0xC440,0x0000,0x0000,0x0000,
/* 'N' */	0x8386,0x8D19,0x3262,0xC587,0x0400,0x0000,0x0000,
/* 'O' */	0x3C42,0x8181,0x8181,0x8181,0x423C,0x0000,0x0000,0x0000,
/* 'P' */	0xFD06,0x0C18,0x3FA0,0x4081,0x0000,0x0000,0x0000,
/* 'Q' */	0x3C42,0x8181,0x8181,0x818D,0x423D,0x0000,0x0000,0x0000,
/* 'R' */	0xFD06,0x0C18,0x3FA2,0x4285,0x0400,0x0000,0x0000,
/* 'S' */	0x7D06,0x0C07,0x0180,0xC182,0xF800,0x0000,0x0000,
/* 'T' */	0xFE20,0x4081,0x0204,0x0810,0x2000,0x0000,0x0000,
/* 'U' */	0x8306,0x0C18,0x3060,0xC144,0x7000,0x0000,0x0000,
/* 'V' */	0x80C0,0x5048,0x2221,0x1050,0x2808,0x0400,0x0000,0x0000,0x0000,
/* 'W' */	0x820C,0x2851,0x448A,0x2451,0x1450,0xA285,0x1410,0x4082,0x0000,0x0000,0x0000,0x0000,0x0000,
/* 'X' */	0x8289,0x1141,0x020A,0x2245,0x0400,0x0000,0x0000,
/* 'Y' */	0x8289,0x1142,0x8204,0x0810,0x2000,0x0000,0x0000,
/* 'Z' */	0x7E08,0x2041,0x0208,0x1041,0xFC00,0x0000,0x0000,
/* '[' */	0xEAAA,0xAAC0,
/* '\' */	0x8844,0x4222,0x1100,0x0000,
/* ']' */	0xD555,0x55C0,
/* '^' */	0x0114,0xA544,0x0000,0x0000,0x0000,
/* '_' */	0x0000,0x0000,0x0000,0x0000,0x0000,0x0FE0,0x0000,
/* '`' */	0x9000,0x0000,
/* 'a' */	0x0000,0xE885,0xF19B,0x4000,0x0000,
/* 'b' */	0x8421,0x6CC6,0x318F,0x8000,0x0000,
/* 'c' */	0x0000,0xE8C2,0x108B,0x8000,0x0000,
/* 'd' */	0x0842,0xD9C6,0x318B,0xC000,0x0000,
/* 'e' */	0x0000,0xE8C7,0xF08B,0x8000,0x0000,
/* 'f' */	0x344E,0x4444,0x4400,0x0000,
/* 'g' */	0x0000,0xD9C6,0x319B,0x4317,0x0000,
/* 'h' */	0x8421,0x6CC6,0x318C,0x4000,0x0000,
/* 'i' */	0x9FC0,
/* 'j' */	0x4155,0x5580,
/* 'k' */	0x8421,0x1953,0x9294,0x4000,0x0000,
/* 'l' */	0xFFC0,
/* 'm' */	0x0000,0x0016,0x6CCC,0x4623,0x1188,0xC440,0x0000,0x0000,0x0000,
/* 'n' */	0x0001,0x6CC6,0x318C,0x4000,0x0000,
/* 'o' */	0x0000,0xE8C6,0x318B,0x8000,0x0000,
/* 'p' */	0x0001,0x6CC6,0x31CD,0xA108,0x0000,
/* 'q' */	0x0000,0xD9C6,0x319B,0x4210,0x8000,
/* 'r' */	0x005D,0x2490,0x0000,
/* 's' */	0x0000,0xE8C1,0xC18B,0x8000,0x0000,
/* 't' */	0x0974,0x924C,0x0000,
/* 'u' */	0x0001,0x18C6,0x318B,0xC000,0x0000,
/* 'v' */	0x0001,0x18A9,0x4A21,0x0000,0x0000,
/* 'w' */	0x0000,0x0011,0x188A,0xA954,0xAA22,0x1100,0x0000,0x0000,0x0000,
/* 'x' */	0x0001,0x1528,0x8A54,0x4000,0x0000,
/* 'y' */	0x0001,0x18A9,0x4A21,0x084C,0x0000,
/* 'z' */	0x0001,0xF108,0x8847,0xC000,0x0000,
/* '{' */	0x2924,0xA249,0x2200,
/* '|' */	0xFFF0,
/* '}' */	0x8924,0x8A49,0x2800,
/* '~' */	0x0000,0x0007,0x33C0,0x0000,0x0000,0x0000,0x0000,
/* 0x7F */	0xFE18,0x6186,0x1861,0x861F,0xC000,0x0000,
};

static const u16 Roman13_offset[95] = {
    0,    1,    4,   12,   17,   27,   35,   36,   39,   42,   47,   54,   55,   58,   59,   63,
   69,   72,   78,   84,   90,   96,  102,  108,  114,  120,  121,  122,  128,  135,  141,  146,
  158,  167,  174,  181,  188,  195,  201,  209,  216,  217,  222,  230,  236,  245,  252,  260,
  267,  275,  282,  289,  296,  303,  312,  325,  332,  339,  346,  348,  352,  354,  359,  366,
  368,  373,  378,  383,  388,  393,  397,  402,  407,  408,  410,  415,  416,  425,  430,  435,
  440,  445,  448,  453,  456,  461,  466,  475,  480,  485,  490,  493,  494,  497,  504
};

static const u8 Roman13_width[95] = {
 1, 3, 8, 5,10, 8, 1, 3, 3, 5, 7, 1, 3, 1, 4, 6,
 3, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 6, 7, 6, 5,12,
 9, 7, 7, 7, 7, 6, 8, 7, 1, 5, 8, 6, 9, 7, 8, 7,
 8, 7, 7, 7, 7, 9,13, 7, 7, 7, 2, 4, 2, 5, 7, 2,
 5, 5, 5, 5, 5, 4, 5, 5, 1, 2, 5, 1, 9, 5, 5, 5,
 5, 3, 5, 3, 5, 5, 9, 5, 5, 5, 3, 1, 3, 7, 6
};

Roman13::Roman13(u8 fixedWidth) : PackedFont1 (
	33,
	127,
	Roman13_glyphdata,
	Roman13_offset,
	Roman13_width,
	16,
	4,
	9,
	13
) {
	if (fixedWidth) setFontWidth(fixedWidth);
};
